<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改角色信息</title>
<%@ include file="/app/includes/header.jsp"%>
	<script type="text/javascript">
		function updateDict(){
			$('#dictForm').submit();
		}
		$(function(){
				$('#test2').combobox({
				url:'<%=request.getContextPath()%>/system/dict/getDictByType.action?type=type',
				valueField:'id',
				textField:'text',
				onSelect:function(record){
	                $('#test3').combobox({
	                    url:'<%=request.getContextPath()%>/system/dict/getDictByType.action?type='+record.id,
	                    valueField:'id',
	                    textField:'text'
	                }).combobox('clear');
	                 $('#test4').combobox('clear');
	            }
			});	
		
				$('#test3').combobox({
				url:'<%=request.getContextPath()%>/system/dict/getDictByType.action?type=1',
				valueField:'id',
				textField:'text',
				onSelect:function(record){
	                $('#test4').combobox({
	                    url:'<%=request.getContextPath()%>/system/dict/getDictByType.action?type='+record.id,
	                    valueField:'id',
	                    textField:'text'
	                }).combobox('clear');
	            }
			});	
		})
	</script>
</head>
<body>
	<div id="panel" class="easyui-panel" title="修改角色信息"
			icon="icon-save" collapsible="true" style="padding: 10px;">
		<form id="dictForm" action="<%=request.getContextPath()%>/system/dict/updateDictTest.action" method="post" >
			<table class="table_form">
			<tr>
				<td>
					标识:
				</td>
				<td>
					<input id="id" name="id"  type="text" value="${dict.id}" 
						readonly="readonly"></input>
				</td>
				<td colspan="2">
				</td>
			</tr>
			<tr>
				<td>
					部门:
				</td>
				<td>
			
					<select id="test1" class="easyui-combobox" name="test1" style="width:200px;" required="true"></select>
				</td>
				<td colspan="2">
					<div id="valueTip"></div>
				</td>
			</tr>
			<tr>
				<td>
					人力资源:
				</td>
				<td>
					<select id="test2" class="easyui-combobox" name="test2" style="width:200px;" required="true"></select>
				</td>
				<td>
					<select id="test3" class="easyui-combobox" name="test3" style="width:200px;" required="true"></select>
				</td>
				<td>
					<select id="test4" class="easyui-combobox" name="test4" style="width:200px;" required="true"></select>
				</td>
			</tr>
			<tr>
				<td colspan="4">
					<div style="padding: 10px;" >
						<a href="#"  class="easyui-linkbutton" iconCls="icon-ok" 
								onclick="updateDict()">确定</a>
						<a href="javascript:history.back(-1)" class="easyui-linkbutton"  
								iconCls="icon-cancel">取消</a>
					</div>
				</td>
			</tr>
			</table>
		</form>
	</div>
</body>
	<script type="text/javascript">
	$(function(){
				$('#test1').combobox({
				url:'<%=request.getContextPath()%>/system/dict/editDictByType.action?type=2'+ '&selectId='+${dict.test1},
				valueField:'id',
				textField:'text'});
			
				$('#test2').combobox({
				url:'<%=request.getContextPath()%>/system/dict/editDictByType.action?type=type'+ '&selectId='+${dict.test2},
				valueField:'id',
				textField:'text'});
				
			
				$('#test3').combobox({
				url:'<%=request.getContextPath()%>/system/dict/editDictByType.action?type='+ ${dict.test2}+ '&selectId='+${dict.test3},
				valueField:'id',
				textField:'text'});
				
			
				$('#test4').combobox({
				url:'<%=request.getContextPath()%>/system/dict/editDictByType.action?type='+ ${dict.test3}+ '&selectId='+${dict.test4},
				valueField:'id',
				textField:'text'});
				
			})

	</script>
</html>